package com.springcloud.controller;

import java.util.List;

import org.aspectj.internal.lang.annotation.ajcDeclareAnnotation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.springcloud.entity.Dept;
import com.springcloud.service.DeptClientService;





@RestController
public class DeptController_Consumer {
	@Autowired
	 private  DeptClientService  service;
	@RequestMapping("/consumer/dept/add")
	public boolean add(Dept dept) {
		return service.add(dept);
	}
	
	@RequestMapping( "/consumer/dept/get/{deptno}")
	public Dept get(@PathVariable("deptno")int deptno) {
		return service.get(deptno);
	}
	
	@SuppressWarnings("unchecked")
	@RequestMapping("/consumer/dept/list")
	public  List<Dept> list() {
		return service.list();
	}
}
